﻿<%@ Page Language="C#" MasterPageFile="~/UI/Main/Main.Master" AutoEventWireup="true"
    CodeBehind="Search_Calendar.aspx.cs" Inherits="OrganizedIN.UI.Calendar.Search_Calendar" %>
<%@ Register Assembly="AjaxControlToolkit, Version=3.5.40412.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
    Namespace="AjaxControlToolkit" TagPrefix="cc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/JavaScript">
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="middle_tab">
        <div id="middle_tab_title" align="center">
            My Calendar</div>
        <div class="middle_tab_content">
            <br />
            <h4>
                You can Add, Search, Update, Delete, Archive, and Share with your
                Group by clicking on the below icons:</h4>
            <br />
        </div>
        <div id="icon_link_wrapper" align="center">
            <div id="icon_primary_calendar" align="center">
                <a href="Add_New_Calendar.aspx" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Add New','','../../images/add_02.jpg',1)">
                    <img src="../../images/add_01.jpg" alt="Add New" width="75" height="75" border="0" id="Add New" /></a></div>
            <div id="icon_secondary" align="center">
                <a href="Search_Calendar.aspx">
                    <img src="../../images/search_02.jpg" alt="Search" name="Search" width="75" height="75"
                        border="0" id="Search" /></a></div>
            <div id="icon_secondary" align="center">
                <a href="Update_Calendar.aspx" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Update','','../../images/update_02.jpg',1)">
                    <img src="../../images/update_01.jpg" alt="Update" name="Update" width="75" height="75"
                        border="0" id="Update" /></a></div>
            <div id="icon_secondary" align="center">
                <a href="Share_Calendar.aspx" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Share with group','','../../images/share_02.jpg',1)">
                    <img src="../../images/share_01.jpg" alt="Share with group" name="Share with group"
                        width="75" height="75" border="0" id="Share with group" /></a></div>
            <div id="icon_secondary" align="center">
                <a href="Archive_Calendar.aspx" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Archive','','../../images/archive_02.jpg',1)">
                    <img src="../../images/archive_01.jpg" alt="Archive" name="Archive" width="75" height="75"
                        border="0" id="Archive" /></a></div>
        </div>
        <br />
        <br />
        <div class="calendar_table">
            <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
                <tr bgcolor="#d8e1f3">
                    <td width="25%" align="right">
                        <span class="middle_text3">Search by Title:</span>
                    </td>
                    <td width="75%" align="left" class="middle_text3">
                        <asp:TextBox ID="txtsrchbytitle" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr bgcolor="#d8e1f3">
                    <td align="right">
                        <span class="middle_text3">Search by Date:</span>
                    </td>
                    <td align="left" class="middle_text3">
                        <strong> 
                            <asp:TextBox ID="txtSearchByDate" runat="server"></asp:TextBox>  
                             <asp:ImageButton ID="img1" runat="server" ImageUrl="~/images/organizer_ico.gif" />
                            <cc:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtSearchByDate" PopupButtonID="img1">
                            </cc:CalendarExtender>                 
                           <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtSearchByDate" 
                            ErrorMessage="Please enter valid Date Time" Operator="DataTypeCheck" 
                            Type="Date" Display="Dynamic" ValidationGroup="dateval"></asp:CompareValidator>
                        </strong>
                    </td>
                </tr>
                <tr bgcolor="#d8e1f3">
                    <td align="right">
                        <span class="middle_text3">Search by Import Type</span>
                    </td>
                    <td align="left" class="middle_text3">
                        <asp:DropDownList ID="ddlImportType" runat="server">
                            <asp:ListItem Text="Outlook" Value="Outlook" Selected="True" />
                            <asp:ListItem Text="Gmail" Value="Gmail" />
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr bgcolor="#d8e1f3">
                    <td align="right">
                        <span class="middle_text3">Search by Group:</span>
                    </td>
                    <td align="left" class="middle_text3">
                        <asp:TextBox ID="txtsrchbygrp" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr bgcolor="#d8e1f3">
                    <td align="right">
                        <span class="middle_text3">Sort Calendar by:</span>
                    </td>
                    <td align="left" class="middle_text3">
                        <asp:DropDownList ID="ddlsort" runat="server" CssClass="action_list">
                            <asp:ListItem Value="Calendar_Create_Date">Sort by Date Entered</asp:ListItem>
                            <asp:ListItem Value="Calendar_Summary">Sort by Summary</asp:ListItem>
                            <asp:ListItem Value="Calendar_Import_Type">Sort by Import Type</asp:ListItem>
                            <asp:ListItem Value="Calendar_Status">Sort by Status (archived,shared)</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr bgcolor="#d8e1f3">
                    <td>&nbsp;</td>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                    </td>
                </tr>
                <tr bgcolor="#d8e1f3">
                    <td colspan="2" align="left" style="color: #FF0000">
                        <h4>
                            <strong>
                                <asp:Label ID="lblErrMsg" runat="server" Text=""></asp:Label></strong></h4>
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
                <tr bgcolor="#d8e1f3">
                    <td align="left" class="middle_text3">
                        <asp:DataGrid ID="dgSearchResult" runat="server" AllowPaging="true" AutoGenerateColumns="false"
                            HeaderStyle-ForeColor="Purple" PageSize="5" Width="100%" 
                            BorderColor="White" onitemcommand="dgSearchResult_ItemCommand" 
                            onpageindexchanged="dgSearchResult_PageIndexChanged">
                            <ItemStyle BorderColor="White" />
                            <Columns>
                                <asp:TemplateColumn HeaderStyle-Width="5%" HeaderStyle-Font-Bold="true" HeaderStyle-BackColor="#c2cee7"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td align="left" width="50%">
                                                    <img src="../../images/calendar.png" longdesc="#" />
                                                    <asp:Label ID="lblSummary" runat="server" Text='<%#Eval("Calendar_Summary") %>' />
                                                </td>
                                                <td width="30%">
                                                    <asp:DropDownList ID="ddlAction" runat="server">
                                                        <asp:ListItem Value="-1" Selected="True">Select your action</asp:ListItem>
                                                        <asp:ListItem Value="Download">Download</asp:ListItem>
                                                        <asp:ListItem Value="Update">Update</asp:ListItem>
                                                        <asp:ListItem Value="Delete">Delete</asp:ListItem>
                                                        <asp:ListItem Value="Share">Share</asp:ListItem>
                                                        <asp:ListItem Value="Archive">Archive</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                                <td width="20%">
                                                    <asp:Button ID="btnGo" runat="server" CssClass="Button3" BorderWidth="0"
                                                        CommandArgument ='<%#Eval("Calendar_ID") %>' CommandName="Action" />
                                                </td>
                                        </table>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                            </Columns>
                            <PagerStyle Mode="NumericPages" />
                        </asp:DataGrid>
                    </td>
                </tr>
            </table>
        </div>
        <br />
    </div>
</asp:Content>
